package com.example.shirospringboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.example.shirospringboot.model.Permission;
import com.example.shirospringboot.model.RolePermission;

@Mapper
public interface RolePermissionMapper {
    /**
     * delete by primary key
     *
     * @param rolePermissionId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer rolePermissionId);
    
    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(RolePermission record);
    
    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(RolePermission record);
    
    /**
     * select by primary key
     *
     * @param rolePermissionId primary key
     * @return object by primary key
     */
    RolePermission selectByPrimaryKey(Integer rolePermissionId);
    
    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(RolePermission record);
    
    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(RolePermission record);
    
    List<Permission> getPermissionByUserId(@Param("userid") int userid);
    
}